package com.dq.eduservice.client.fallback;

import com.dq.commonutils.vo.Result;
import com.dq.eduservice.client.VodClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 熔断降级操作
 *
 * @project: guli_parent
 * @ClassName: VodClientFallBackFactory
 * @author: dq
 * @creat: 2022/8/3 10:22
 */
@Component
public class VodClientFallBackFactory implements FallbackFactory<VodClient> {


    @Override
    public VodClient create(Throwable throwable) {
        return new VodClient() {
            @Override
            public Result deleteAliyunViedo(String videoSourceId) {
                return Result.error(20001,"删除单个视频失败");
            }

            @Override
            public Result deleteAliyunVideoBatch(List<String> videoIdList) {
                return Result.error(20001,"删除多个视频失败");
            }
        };
    }
};
